package com.gujiangbo.chapter06;

import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/3/29 21:33
 * @Version: 1.0
 * @Description:
 * -Xms600m -Xmx600m
 */
public class JavaHeapInstance {

    byte[] buffer = new byte[new Random().nextInt(1024 * 200)];

    public static void main(String[] args) {

        ArrayList<JavaHeapInstance> javaHeapInstances = new ArrayList<>();
        while (true) {
            javaHeapInstances.add(new JavaHeapInstance());

            //暂停5秒钟线程
            try {
                TimeUnit.MILLISECONDS.sleep(15);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
